<html xmlns='http://www.w3.org/1999/xhtml'
      xmlns:p='http://primefaces.org/ui'
      xmlns:f='http://java.sun.com/jsf/core'
      xmlns:h='http://java.sun.com/jsf/html'
      xmlns:fn='http://java.sun.com/jsp/jstl/functions'
      xmlns:cc='http://java.sun.com/jsf/composite' style='color: inherit'>

<cc:interface>

<cc:attribute name='id'/>

<cc:attribute name='b'/>

<cc:attribute name='p'/>

<cc:attribute name='t'   default='#{cc.attrs.p}'/>

<cc:attribute name='x'   default='b'/>

<cc:attribute name='wT'   default='65'/>

<cc:attribute name='w' default='250px'/>

<cc:attribute name='read' default='#{cc.attrs.b.isRead}'/>

<cc:attribute name='tp'/>

<cc:attribute name='list'/>

<cc:attribute name='onkeydown'/>

<cc:attribute name='onkeypress'/>

<cc:attribute name='sT'/>

</cc:interface>


<cc:implementation>

  <h:panelGrid columns='2' cellpadding='0' cellspacing='0'>

  <h:panelGrid columns='1' cellpadding='0' cellspacing='1' width='#{cc.attrs.wT}' styleClass="#{cc.attrs.read? '':'ui-state-default xFd'}"><span title='#{cc.attrs.tp}' style='#{cc.attrs.sT}'>#{cc.attrs.t}</span></h:panelGrid>

  <p:selectOneMenu value="#{cc.attrs.b.entity[fn:toLowerCase(cc.attrs.p)]}" rendered="#{!cc.attrs.read and cc.attrs.x=='s' and cc.attrs.list == null}" style='width: #{cc.attrs.w}' styleClass='xSel'>

  <cc:insertChildren/></p:selectOneMenu>


  <p:selectOneMenu value="#{cc.attrs.b.entity[fn:toLowerCase(cc.attrs.p)]['id']}"     rendered="#{!cc.attrs.read and cc.attrs.x=='b' and cc.attrs.list == null}" style='width: #{cc.attrs.w}' styleClass='xSel'>

  <f:selectItems value="#{cc.attrs.b['ls'.concat(cc.attrs.p)]}" var='x' itemLabel='#{x.nombre}' itemValue='#{x.id}' itemDescription='#{x.id.toString()}'/></p:selectOneMenu>


  <p:selectOneMenu value="#{cc.attrs.b.entity[fn:toLowerCase(cc.attrs.p)]['id']}"     rendered="#{!cc.attrs.read and cc.attrs.x=='b' and cc.attrs.list != null}" style='width: #{cc.attrs.w}' styleClass='xSel'>

  <f:selectItems value='#{cc.attrs.list}' var='x' itemLabel='#{x.nombre}' itemValue='#{x.id}' itemDescription='#{x.id}'/></p:selectOneMenu>


  <h:outputText    value="#{cc.attrs.b.entity[fn:toLowerCase(cc.attrs.p)]['nombre']}" rendered='#{ cc.attrs.read}' style='width: #{cc.attrs.w}' styleClass='xIn'/>

  </h:panelGrid>

</cc:implementation>

</html>